#ifndef ABSTRACTSOCKET_H
#define ABSTRACTSOCKET_H

#include <arpa/inet.h>
#include <string>
#include <sys/types.h>

class AbstractSocket
{
public:
    virtual           ~AbstractSocket();

    virtual bool       close();
    std::string        errorString() const;
    std::string        interface() const;
    bool               isOpen() const;
    int                socketError() const;

protected:
                       AbstractSocket();

    int                iSocket_;
    struct sockaddr_in sin_;
    socklen_t          length_;

    int                iError_;

    bool               isOpen_;
};

#endif // ABSTRACTSOCKET_H
